import request from '@/utils/request'
import { apiVersion } from '@/config'

// 获取所有用户
export function userAll(data) {
    return request({
        url: `/user/${apiVersion}/user/all`,
        method: 'get',
        data
    })
}

// 获取用户所在机构列表
export function userOrgs(data) {
    return request({
        url: `/user/${apiVersion}/user/orgs`,
        method: 'get',
        data
    })
}

// 切换机构
export function switchOrganization(data) {
    return request({
        url: `/user/${apiVersion}/user/switchOrganization?organizationId=`+data.organizationId,
        method: 'put',
        data
    })
}

// 修改用户
export function putUser(data) {
    return request({
        url: `/user/${apiVersion}/user`,
        method: 'put',
        data
    })
}
